<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/8/17
 * Time: 16:08
 */
namespace app\wechat\service;

use app\common\model\Category;

class CategoryService
{
    private static $category;

    public function __construct()
    {
        self::$category = new Category();
    }

    public static function getCategoryDetail($limit)
    {
        new self;
        $list = self::_getCategoryList($limit);
        $total = self::_getCategoryTotal();
        $return = [
            'data' => $list,
            'total' => $total,
        ];
        return $return;
    }

    private static function _getCategoryList($limit)
    {
        $list = self::$category->getList($limit);
        return $list;
    }

    private static function _getCategoryTotal()
    {
        $total = self::$category->getTotal();
        return $total;
    }


}